﻿@inject LayoutDataServices data

@{
    var qq_state = Guid.NewGuid().ToString();
    var session = Context.Session;
    session.SetString("qq_state", qq_state);
    ViewData["qq_state"] = qq_state; // 随机码, 防止CSRF攻击
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>@(ViewData["title"] != null ? $"{ViewData["title"].ToString()}-" : "")@data.getSiteTitle()</title>

    <environment include="Development">
        <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
              asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
              asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
    </environment>
    <environment exclude="Development">

    </environment>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="~/lib/sweetalert/dist/sweetalert.css" />
    <link href="~/css/layout_top.css" rel="stylesheet" />
    @RenderSection("styles", required: false)
</head>
<body>

    @Html.Partial("_LayoutHeader")

    @*主体*@
    <div id="main" style="width:1200px;height:auto;" class="center-block">

        @*简介*@
        @Html.Partial("_LayoutSummry")

        @*广告位内容设置*@
        @Html.Partial("_LayoutAdvertising")

        @*中间主要内容部分*@
        <div id="rb" class="container-fluid" style="background-color:white;">
            <div class="row">
                @*左侧,模板页公共部分*@
                <div style="height:10px;background-color:white"></div>

                <div class="col-lg-8" style="background-color:#f3ece2;opacity:0.9;">
                    @RenderBody()
                </div>

                @*右侧,模板页公共部分*@
                <div class="col-lg-4" style="background-color:#FDFDF8;">
                    <div class="row">
                        @*公告板*@
                        <div class="aside-box">
                            <div style="color:darkgray;" class="text-left aside-title">今日公告</div>
                            <div style="color:#666;min-height:175px;">
                                @{
                                    var notice = data.getNotice();
                                    if (notice != null)
                                    {
                                        @Html.Raw(notice.content)
                                    }
                                }
                            </div>
                        </div>

                        @*八字简批*@
                        @Html.Partial("_LayoutForecast")

                        @*帖子,管理员可以设置置顶*@
                        @Html.Partial("_LayoutTopic")

                        @*其他分类的文章*@
                        @Html.Partial("_LayoutOtherCategory")
                    </div>
                </div>
            </div>
            @*右侧公用部分结束*@

        </div>
    </div>

    <div class="text-center">
        <div style="display:inline-block;">
            <div class="bdsharebuttonbox">
                <a href="#" class="bds_more" data-cmd="more"></a>
                <a href="#" class="bds_qzone" data-cmd="qzone"></a>
                <a href="#" class="bds_tsina" data-cmd="tsina"></a>
                <a href="#" class="bds_tqq" data-cmd="tqq"></a>
                <a href="#" class="bds_renren" data-cmd="renren"></a>
                <a href="#" class="bds_weixin" data-cmd="weixin"></a>
            </div>
        </div>
    </div>

    @Html.Partial("_LayoutBottom")

    <environment include="Development">
        <script type="text/javascript">
            if (location.href.indexOf('localhost') >= 0 || location.href.indexOf('127.0.0.1') >= 0) {
                console.log("debug模式自动登录");
                localStorage.setItem("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaWQiOiIwOGQ2MmFiOS00ZjA3LThjMzYtZjdhNi0wNTgwZGI4MDFiOTgiLCJuYmYiOjE1Mzg3NTk5MTksImV4cCI6MTU0MTE3OTExOSwiaXNzIjoiV2VpUWluZ0x1blRhbiIsImF1ZCI6IldlYkJyb3dzZXIifQ.-bztj9R3dTpel9afa8kVy5eVtz_v4n1AQA_TmUVok-k");
            }
        </script>
    </environment>
    <environment exclude="Development">

    </environment>

    <script src="~/lib/jquery/dist/jquery.js"></script>
    <script src="~/js/jquery.cookie.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
    <script src="~/lib/wangEditor/wangEditor.js"></script>
    <script src="~/lib/upload/jquery.form.js"></script>
    <script src="~/js/pack-manage/sweetalert.min.js"></script>
    <script src="~/js/utils.js"></script>
    <script type="text/javascript" src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
    <script language="javascript" type="text/javascript" src="~/plugins/My97DatePicker/WdatePicker.js"></script>
    <script src="~/lib/bshare/baidu_share.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    <script type="text/javascript">
            @{
                if(session.Keys.Contains("jwtToken"))
                {
                    @:localStorage.setItem('token', '@session.GetString("jwtToken")');
                }
            }
    </script>

    @RenderSection("Scripts", required: false)

</body>
</html>
